<?php

namespace App\Resources\Collections;

use Illuminate\Http\Resources\Json\ResourceCollection;

class UserSocialAccountCollection extends ResourceCollection
{
    public function toArray($request)
    {
        return $this->collection->transform(function ($data) {
            return [
                'id' => (int)$data->id,
                'type' => (int)$data->type,
                'openid' => $data->openid,
                'nickname' => $data->nickname,
                'gender' => $data->gender,
                'avatar' => $data->avatar,
            ];
        });
    }
}